//1.数组的深度拷贝
let deepClone = data => {
    let result = []
    data.forEach((value, i) => {
        if(typeof(value) === 'object'){
            result[i] = deepClone(value)
        }
        else 
            result[i] = value
    })
    return result
}


//浅拷贝
let arr2 = [1, 23, 4, [1, 2, 3]]
let arr3 = deepClone(arr2)
arr2[3][1] = 5
console.log(arr3[3][1])